
import request from '@/plugin/axios'

// 获取分页列表
export function getGoodCategoryPage (params) {
  return request({
    url: '/mall/goodcategory/page',
    method: 'get',
    params: request.adornParams(params)
  })
}

// 获取列表
export function getGoodCategoryList (params) {
  return request({
    url: '/mall/goodcategory/list',
    method: 'get',
    params: request.adornParams(params)
  })
}

// 获取树列表
export function getGoodCategoryTree(params) {
    return request({
        url: '/mall/goodcategory/tree',
        method: 'get',
        params: request.adornParams(params)
    })
}

// 获取信息
export function getGoodCategoryInfo (id) {
  return request({
    url: '/mall/goodcategory/info/' + id,
    method: 'get',
    params: request.adornParams({})
  })
}

// 添加
export function addGoodCategory (data) {
  return request({
    url: '/mall/goodcategory/save',
    method: 'post',
    data
  })
}

// 修改
export function updateGoodCategory (data) {
  return request({
    url: '/mall/goodcategory/update',
    method: 'put',
    data
  })
}

// 批量删除
export function delBatchGoodCategory (params) {
  return request({
    url: '/mall/goodcategory/delete',
    method: 'post',
    data: request.adornData(params, false)
  })
}

// 删除
export function delGoodCategory(id) {
  return request({
    url: '/mall/goodcategory/delete/' + id,
    method: 'delete',
  })
}